package com.xiaoyun.handle;

import com.xiaoyun.util.ServiceTools;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class MyInvocationHandle implements InvocationHandler {
    private  Object target;

    public MyInvocationHandle(Object target) {
        this.target = target;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        Object res = null;
        ServiceTools.log();

        res = method.invoke(target,args);

        ServiceTools.trans();
        return res;
    }
}
